import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    name:'home',
    component: () => import("../views/main/Main.vue"),
    redirect: '/home/goods',
    children: [
      { //子组件内容要想在Layout中显示，Layout组件中必须给出口<router-view></router-view>
        path: '/home/goods',
        component: () => import("../views/main/mai_modules/Goods.vue")
      },
      { //子组件内容要想在Layout中显示，Layout组件中必须给出口<router-view></router-view>
        path: '/home/comment',
        component: () => import("../views/main/mai_modules/Comment.vue")
      },
      { //子组件内容要想在Layout中显示，Layout组件中必须给出口<router-view></router-view>
        path: '/home/shop',
        component: () => import("../views/main/mai_modules/Shop.vue")
      }
    ]
  },
  // 商品详情页
  {
    path: '/good/about',
    name:'good',
    component: () => import("../views/goodsabout/GoodsAbout.vue"),
  },


 

]

const router = new VueRouter({
  routes
})

export default router
